package com.trade.wzj.service.yang.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.trade.wzj.dao.yang.CompanyPurchaseinfoDaoYang;
import com.trade.wzj.service.yang.CompanyPurchaseinfoServiceYang;

@Service("CompanyPurchaseinfoServiceYang")
public class CompanyPurchaseinfoImplYang implements CompanyPurchaseinfoServiceYang {
	
	@Autowired
	@Qualifier("CompanyPurchaseinfoDaoYang")
	private CompanyPurchaseinfoDaoYang companyPurchaseinfo;

	public CompanyPurchaseinfoDaoYang getCompanyPurchaseinfo() {
		return companyPurchaseinfo;
	}


	public void setCompanyPurchaseinfo(CompanyPurchaseinfoDaoYang companyPurchaseinfo) {
		this.companyPurchaseinfo = companyPurchaseinfo;
	}


	@Override
	public int updateClientOrderState(Integer stateID, Integer id) throws Exception {
		int num = 0;
		if(stateID!=null&&id!=null) {
			try {
				num = companyPurchaseinfo.updateClientOrderState(stateID, id);
			} catch (Exception e) {
				e.printStackTrace();
				throw new Exception("修改状态失败！");
			}
		}else {
			throw new Exception("获取需要修改的数据失败！");
		}
		return num;
	}

}
